using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using BesAsm.MasterData.Entities;
using BesAsm.MasterData.Services;
using BesAsm.MasterData.Gis;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.ADF.BaseClasses;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Framework;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.esriSystem;

namespace BesAsm.Emgaats.TracerUI
{
  /// <summary>
  /// ArcGIS Command for adding a selected feature to the StopLinks collections
  /// </summary>  
  [ClassInterface(ClassInterfaceType.None)]  
  public class SelectStopLinkCommand : ESRI.ArcGIS.Desktop.AddIns.Button
  {    
    private TracerExtension _tracerExtension;    

    private IArcList<Link> stopLinks;

    public SelectStopLinkCommand()
    {     
      ESRI.ArcGIS.esriSystem.UID u;
      u = new ESRI.ArcGIS.esriSystem.UIDClass();
      u.Value = ThisAddIn.IDs.TracerExtension;
      _tracerExtension = (TracerExtension)ArcMap.Application.FindExtensionByCLSID(u);
    }

    protected override void OnClick()
    {
      try
      {
        _tracerExtension.RefreshStopLinks();       
      }
      catch (Exception ex)
      {
        MessageBox.Show(ex.Message, "Error Selecting Stop Links");
        return;
      }

    }    

  } // class SelectStopLinkTool
}
